package cn.as142.config;

import cn.as142.pojo.Teacher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author XiaoMo
 * @Date 2022/3/15 10:54
 * @Version 1.0
 */
@Configuration//配置类
public class JavaConfig {

    //像spring的ioc容器注入一个Teacher对象 initMethod实例化对象后执行的方法
    @Bean(initMethod = "init")
    public Teacher teacher() {
        Teacher teacher = new Teacher();
        return teacher;
    }
}
